#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main() {
    int num;
    scanf("%d", &num);
    int arr[num];
    for (int i = 0; i < num; i++)
    {
        scanf("%d ", &arr[i]);
    }
    int tmp;
    scanf("%d", &tmp);
    int m = 0;
    for (int i = 0; i < num; i++)
    {
        if (arr[i] != tmp)
            printf("%d ", arr[i]);
    }

    return 0;
}